﻿using System;

using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using System.Data.SQLite;
using System.Data;

namespace WABDCUI
{
    public static class Helper
    {
        private static string workingDir;
        private static IntStrComparer intStrComparer;

        public static string getWorkingDir()
        {
            if (workingDir == null)
            {
                //get working dir
                FileInfo currentAppFile = new FileInfo(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
                workingDir = currentAppFile.Directory.FullName;
            }
            return workingDir;
        }

        public static IntStrComparer getIntStrComparer()
        {
            if (intStrComparer == null)
            {
                intStrComparer = new IntStrComparer();
            }
            return intStrComparer;
        }

        public static string getBookDir()
        {
            return getWorkingDir() + "\\Books";
        }

        public static string getBookDirByName(string bookName)
        {
            return getBookDir() + "\\" + bookName;
        }

        public static string getDataDir()
        {
            return getWorkingDir() + "\\Data";
        }
    }
}
